/**
 * @File Name: common.c
 * @brief  
 *  一些公共定义
 * @Author : LiWanglin email:lwl510ll@163.com
 * @Version : 1.0
 * @Creat Date : 2023-07-21
 * 
 * @copyright Copyright (c) 2023 LiWanglin
 */

#include "common.h"
#include <stdio.h>


cm_uint8 check_code_calculation(cm_uint8 *data, cm_uint16 len)
{
    if(NULL == data) {
        return 0;
    }

    cm_uint8 crc = 0;
    for(cm_uint16 i = 0; i < len; i++) {
        crc ^= data[i];
    }

    return crc;
}